package it.polimi.jita.cp.block.scheduler;

public class VirtualMachine implements IVirtualMachineSchedulerData {
	private final Double demand;
	private final Double reservation;
	private final Double limit;
	private final Integer shares;
	private Double run;
	private String name;

	protected VirtualMachine(Double demand, Double reservation, Double limit,
			Integer shares) {
		super();
		this.demand = demand;
		this.reservation = reservation;
		this.limit = limit;
		this.shares = shares;
	}

	@Override
	public Double getDemand() {
		return demand;
	}

	@Override
	public Double getReservation() {
		return reservation;
	}

	@Override
	public Double getLimit() {
		return limit;
	}

	@Override
	public Double getRun() {
		return run;
	}

	@Override
	public void setRun(Double run) {
		this.run = run;
	}

	@Override
	public Integer getShares() {
		return shares;
	}

	public boolean isNeedFrequency() {
		return run < demand;
	}

	@Override
	public String getName() {
		return name;
	}

	protected void setName(String name) {
		this.name = name;
	}

}
